{% extends "forum_base.html" %}
{% load i18n %}

{% block title %}{{ forum.title }}{% endblock %}


{% block extrahead %}
<link rel="alternate" type="application/rss+xml" title="{{ forum.title }} Posts via RSS" href="{% url forum_index %}rss/{{ forum.slug }}/" />
<link rel="alternate" type="application/atom+xml" title="{{ forum.title }} Posts via ATOM" href="{% url forum_index %}atom/{{ forum.slug }}/" />
{% endblock %}

{% block pagetitle %}{{ forum.title }}{% endblock %}

{% block breadcrumbs %} {% for title, url in forum.get_url_name %} &raquo; <a href='{{ url }}'>{{ title }}</a> {% endfor %} ({{ forum.threads }} thread{{ forum.threads|pluralize }}, {{ forum.posts }} post{{ forum.posts|pluralize }}){% endblock %}


{% block content %}

{% if child_forums %}
	<table  class="full">
		<tr>
		<th>版块</th>
		<th>最后发帖</th>
		</tr>
		{% for subforum in child_forums %}
		<tr>
		<td><p><strong><a href='{{ subforum.get_absolute_url }}'>{{ subforum.title }}</a></strong><br /><span class='djangoForumStats'>{{ subforum.threads }} thread{{ subforum.threads|pluralize }}, {{ subforum.posts }} post{{ subforum.posts|pluralize }}</span></p>
		<p>{{ subforum.description }}</p></td>
		{% with subforum.forum_latest_post as latest_post %}
		<td>{% if latest_post %}{{ latest_post.time|timesince }} 前由 {{ latest_post.author }} 回复 (<a href='{{ latest_post.get_absolute_url }}'>查看</a>){% else %}无回复{% endif %}</td>
		{% endwith %}
		</tr>
		{% endfor %}
	</table>
{% else %}
	<h1><a href="#" class="bold">{{ forum.title }}</a></h1>
	<table cellspacing="0" cellpadding="0" class="full">
	<thead>
	<tr>
		<td class="folder">图例</td>
		<td class="icon">?</td>
		<th>帖子</th>
		<td class="author">楼主</td>
		<td class="nums">回复/查看</td>
		<td  style='width: 220px;' class="lastpost">最后发表</td>
	</tr>
	</thead>



	{% for t in thread_list %}
	<tbody id="normalthread_{{ t.id }}" >
	<tr>
	<td class="folder">
	    {% if t.sticky %}Sticky {% endif %}
	    {% if t.closed %}<img src="{{ MEDIA_URL }}themes/yaml/images/forum/folder_lock.gif" />{% endif %}
	    <a href="{{ t.get_absolute_url }}" title="新窗口打开" target="_blank"><img src="{{ MEDIA_URL }}themes/yaml/images/forum/folder_common.gif" /></a></td>
	<td class="icon">&nbsp;</td>


	<th class="common" >
	<label>{% if t.agree %}<img src="{{ MEDIA_URL }}themes/yaml/images/forum/agree.gif" alt="" />{% else %}{% endif %}
	{% if t.sticky %}<img src="{{ MEDIA_URL }}themes/yaml/images/forum/pin_1.gif" alt="本版置顶" />{% else %}{% endif %}
	{% if t.jinghua %}<img src="{{ MEDIA_URL }}themes/yaml/images/forum/digest_1.gif" alt="精华 1" /> {% else %}{% endif %}
	</label>
	<span id="thread_{{ t.id }}"><a href="{{ t.get_absolute_url }}">{{ t.title|escape }}</a></span>
	</th>
	
	
	<td class="author bg_blue">
	<cite>
	<a href="space/?action=viewpro&amp;uid=87212">{{ t.author }}</a>
	</cite>
	<em>2008-11-18</em></td>
	<td class="nums"><strong>{{ t.posts }}</strong> / <em>{{ t.views }}</em></td>
	<td class="lastpost bg_blue">
	    {% with t.thread_latest_post as latest_post %}
	    <em><a href="{{ latest_post.get_absolute_url }}">{{ latest_post.time|timesince }}前</a></em><cite>由 <a href="space/?action=viewpro&amp;username=5m44595">{{ latest_post.author }}</a></cite> 回复</td>
	    {% endwith %}
	</tr>
	</tbody>
	{% endfor %}
	
	</table>

	{% if is_paginated %}
	<ul class='list'>
	  <li class="djangoForumPagination"><a href="?page=1">{% trans "First" %}</a></li>
	{% for page_number in paginator.page_range %}
	  <li class="djangoForumPagination"><a href="?page={{ page_number }}">{{ page_number }}</a></li>  
	{% endfor %}
	  <li class="djangoForumPagination"><a href="?page={{ paginator.num_pages }}">{% trans "Last" %}</a></li>  
	</ul>
	{% endif %}
	<div>图标:
	<img src="{{ MEDIA_URL }}themes/yaml/images/forum/folder_common.gif" />没有新帖
	<img src="{{ MEDIA_URL }}themes/yaml/images/forum/folder_lock.gif" />被锁定
	<img src="{{ MEDIA_URL }}themes/yaml/images/forum/folder_new.gif" />新帖
	<img src="{{ MEDIA_URL }}themes/yaml/images/forum/folder_hot.gif" />热帖
	</div>


	<h2>我要发帖</h2>
	{% if user.is_authenticated %}
	<form method='post' enctype="multipart/form-data" action='new/'>
	<p><label>作为</label><span>{{ user.username }}</span></p>
<table>
{{ form.as_table }}
 </table>
	<p><input type='submit' value='Post' /></p>
	</form>
	{% else %}
	<p>请<a href="{% url forum_new_thread forum=forum.slug %}">登录</a>后再来发帖.</p>
	{% endif %}
{% endif %}


{% endblock %}
